import request from '@/utils/request'

// 查询表单明细（不分页） /archive/formManageDetail/listNoPage
export function listNoPage(query) {
  return request({
    url: '/archive/formManageDetail/listNoPage',
    method: 'get',
    params: query
  })
}

// 获取父节点数据
export function ruleList(query) {
  return request({
    url: '/archive/RULE/ruleList',
    method: 'get',
    params: query
  })
}

// 获取子节点数据
export function childList(query) {
  return request({
    url: '/archive/RULE/list',
    method: 'get',
    params: query
  })
}

// 添加父元素
export function addRule(data) {
  return request({
    url: '/archive/RULE',
    method: 'post',
    data: data
  })
}

// 删除父元素
export function delParentRule(ruleId) {
  return request({
    url: '/archive/RULE/deleteGroup/' + ruleId,
    method: 'delete'
  })
}

// 批量添加子元素
export function addRuleBatch(data) {
  return request({
    url: '/archive/RULE/batch',
    method: 'post',
    data: data
  })
}

// 删除子元素
export function delChildRule(ruleId) {
  return request({
    url: '/archive/RULE/' + ruleId,
    method: 'delete'
  })
}

// 查询分单规则列表
export function listRULE(query) {
  return request({
    url: '/archive/RULE/list',
    method: 'get',
    params: query
  })
}

// 查询分单规则详细
export function getRULE(ruleId) {
  return request({
    url: '/archive/RULE/' + ruleId,
    method: 'get'
  })
}

// 新增分单规则
export function addRULE(data) {
  return request({
    url: '/archive/RULE',
    method: 'post',
    data: data
  })
}

// 修改分单规则
export function updateRULE(data) {
  return request({
    url: '/archive/RULE',
    method: 'put',
    data: data
  })
}

// 删除分单规则
export function delRULE(ruleId) {
  return request({
    url: '/archive/RULE/' + ruleId,
    method: 'delete'
  })
}
